home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Modules / BackSpaceModules / Source / QizColorView / QixView.h < prev    next >
Text File  |  1991-11-07  |  3KB  |  105 lines

  1.  
  2. #import    <appkit/View.h>
  3. #import    <appkit/graphics.h>
  4.  
  5. /*
  6.  *    This class implements what I've heard called, Qix lines.
  7.  *
  8.  *    Please send any suggestions for improving or correcting this
  9.  *    screen saver to larry@netcom.com.  Have fun!
  10.  *
  11.  */
  12.  
  13. /**********************************************************************/
  14.  
  15. typedef    struct    moveable_point    // All values neccessary to keep track
  16.         {                        // of a moving points position and direction.
  17.  
  18.                 int    x;                // x coordinate of the point.
  19.                 int    y;                // y coordinate of the point.
  20.                 
  21.                 int    x_dir;            // Points "x" direction, LEFT or RIGHT.
  22.                 int    y_dir;            // Points "y" direction, UP or DOWN.
  23.                 
  24.                 float    x_inc;        // Amount to move point in x's direction.
  25.                 float    y_inc;        // Amount to move point in y's direction.
  26.                 
  27.                 float    orig_inc;    // Used to reset x_inc and y_inc.
  28.         }
  29.         MVPOINT;
  30.  
  31.  
  32. typedef    struct    qix_line        // Two moveable points make a moving line.
  33.         {
  34.             MVPOINT    pointA;
  35.             MVPOINT    pointB;
  36.         }
  37.         QIX;
  38.  
  39. /*********************************************************************/
  40.  
  41. @interface QixView : View
  42. {
  43.     QIX        head;            // Head Qix values. Drawn in white.
  44.     QIX        tail;            // Tail Qix values. Drawn in black.
  45.     
  46.     int        tailLen;        // Current length of tail.
  47.     
  48. }
  49.  
  50. /*********************************************************************/
  51.  
  52. //--------------------------------------------------------------//
  53. //                                                                //
  54. - setQixPoint : ( MVPOINT * ) qix;                                //
  55. //                                                                //
  56. //    Sets a movable points next position.                        //
  57. //                                                                //
  58. //--------------------------------------------------------------//
  59.  
  60. //--------------------------------------------------------------//
  61. //                                                                //
  62. - resetQix : ( QIX * ) qix : ( BOOL ) resetControls;            //
  63. //                                                                //
  64. //    Resets a qix points fields to default values.                //
  65. //                                                                //
  66. //--------------------------------------------------------------//
  67.  
  68. //--------------------------------------------------------------//
  69. //                                                                //
  70. - initFrame  : ( const NXRect * ) frameRect;                    //
  71. //                                                                //
  72. //    Calls resetQix to reset the head and tail qix.                 //
  73. //                                                                //
  74. //--------------------------------------------------------------//
  75.  
  76. - (const char *) windowTitle;
  77.  
  78. //--------------------------------------------------------------//
  79. //                                                                //
  80. - drawSelf : ( NXRect * ) r : ( int ) count;                    //
  81. //                                                                //
  82. //    Clears its view to a black background and calls resetQix,    //
  83. //    to reset the head and tail qix to their default values.        //
  84. //                                                                //
  85. //--------------------------------------------------------------//
  86.  
  87. //--------------------------------------------------------------//
  88. //                                                                //
  89. - drawQix : ( QIX ) qix;                                        //
  90. //                                                                //
  91. //    Draws a line between the two points in a qix structure.        //
  92. //                                                                //
  93. //--------------------------------------------------------------//
  94.  
  95. //--------------------------------------------------------------//
  96. //                                                                //
  97. - oneStep;                                                        //
  98. //                                                                //
  99. //    This is it the master method.  This method is the control    //
  100. //    center for animating the qix lines.                            //
  101. //                                                                //
  102. //--------------------------------------------------------------//
  103.  
  104. @end
  105.